# 石头剪子布的游戏是人机大战 机器随机给出  人按照需求填写
import random

if __name__ == '__main__':

    while True:
        result = int(input("请选择你要出的选项：1：石头 2：剪刀 3：布"))
        # 定义机器随机选择的选项   1：石头 2：剪刀 3：布
        num = random.randint(1, 3)
        print("机器出了%d"%num)

        # 出的一样的结果
        if result == num:
            print("平局")
        elif result == 1 and num == 2:
            print("你赢了")
        elif result == 1 and num == 3:
            print("你输了")
        elif result == 2 and num == 1:
            print("你输了了")
        elif result == 2 and num == 3:
            print("你赢了")
        elif result == 3 and num == 2:
            print("你输了")
        elif result == 3 and num == 1:
            print("你赢了")
        elif result ==4:
            print("游戏结束")
            break
        else:
            print("输入有误")
